﻿#ifndef SERIALTHREAD_H
#define SERIALTHREAD_H

#include <QObject>
#include <QTimer>
#include <QSerialPort>
#include <QSerialPortInfo>

class serialThread : public QObject
{
public:
    serialThread(QObject* parent = nullptr);
    virtual ~serialThread();

public slots:
    void SlotWriteAsciiFont(const QString&);

    void SlotOpenSerial(const QString&, int baudrate = 115200);
    void SlotCloseSerial();

private slots:
    void SlotTimerOut();

private:
    QSerialPort* _serialPort;
    QSerialPortInfo* _serialPortInfo;
    QTimer* _timer;

    bool isOpen = false;
};

#endif // SERIALTHREAD_H
